import request from '@/utils/request.js'

// 新用户注册
export const userReguserService = (data) => {
    return request.post('/api/reguser', data)
}

// 用户登录
export const userLoginService = (data) => {
    return request.post('/api/login', data)
}

// 获取用户基本信息
export const userGetUserInfoService = () => {
    return request.get('/my/userInfo')
}

// 修改用户基本信息
export const userUpdateUserInfo = (data) => {
    return request.post('/my/userInfo', data)
}

// 修改用户密码
export const userUpdatePwdService = (data) => {
    return request.post('/my/updatepsd', data)
}

// 上传头像
export const userUpdateAvatarService = (avatar) => {
    return request.post('/my/updatetar', { avatar })
}

// 管理员获取学生信息
export const userGetStudentService = () => {
    return request.get('/ma/manage')
}

// 增加学生信息
export const userAddStudentService = (data) => {
    return request.post('/ma/addStudent', data)
}

// 删除学生信息
export const userDelStudentService = (data) => {
    return request.post('/ma/delStudent', data)
}

// 修改学生信息
export const userUpdateStudentService = (data) => {
    return request.post('/ma/updateStudent', data)
}

// 管理员获取教师信息
export const userGetTeacherService = () => {
    return request.get('/ma/getTeacher')
}

// 删除教师信息
export const userDelTeacherService = (data) => {
    return request.post('/ma/delTeacher', data)
}

// 增加教师信息
export const userAddTeacherService = (data) => {
    return request.post('/ma/addTeacher', data)
}

// 修改教师信息
export const userUpdateTeacherService = (data) => {
    return request.post('/ma/updateTeacher', data)
}